package com.cn.hnust.service.impl;

import org.springframework.stereotype.Service;

import com.cn.hnust.dao.ICustomerDao;
import com.cn.hnust.pojo.Customer;
import com.cn.hnust.service.ICustomerService;

import javax.annotation.Resource;
import java.util.List;

@Service(value = "customerService")
public class CustomerServiceImpl implements ICustomerService {

    @Resource
    private ICustomerDao customerMapper;

    @Override
    public int insertCustomer(Customer customer) {
        return customerMapper.insertCustomer(customer);
    }

    @Override
    public int updateCustomerById(Customer customer) {
        return customerMapper.updateCustomerById(customer);
    }

    @Override
    public List<Customer> selectAllCustomer(Customer customer) {
        return customerMapper.selectAllCustomer(customer);
    }

    @Override
    public Customer checklogin(String copenid, String cname, String cpwd) {
        return customerMapper.checklogin(copenid,cname,cpwd);
    }

    @Override
    public List<Customer> selectCustomer(String cname) {
        return customerMapper.selectCustomer(cname);
    }

    @Override
    public Customer selectCustomerByOpenid(String copenid) {
        return customerMapper.selectCustomerByOpenid(copenid);
    }

    @Override
    public Customer selectCustomerById(Integer id) {
        return customerMapper.selectCustomerById(id);
    }

	@Override
	public int updateByPrimaryKeySelective(Customer Customer) {
		// TODO Auto-generated method stub
		return this.customerMapper.updateByPrimaryKeySelective(Customer);
	}

	@Override
	public int insertSelective(Customer Customer) {
		// TODO Auto-generated method stub
		return this.customerMapper.insertSelective(Customer);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return this.customerMapper.deleteByPrimaryKey(id);
	}
}
